<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../ucs.css">
    <link rel="stylesheet" href="../font/iconfont.css">
    <link rel="stylesheet" href="../demo.css">
</head>
<body>
    <div id="main"></div>
    <script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
    <script type="text/javascript" src="../../dist/libs/engine.js"></script>
    <script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>

    <script type="text/javascript">
        //分页条模型
        var paginationDM = new UDM({
            value: {	//默认值为0
                totalPage: 0,	//总页数
                pageSize: 4,	//每页显示条数
                curPage: 1	//当前页码
            },
            onClick:function(){
                ajaxFn();
            }
        });
        //个人实名信息
        var realNameInfoDM = new UDM({
            value:{
                AccType:1,
                Mobile:"",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../demoUserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../demoUserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../demoMyBankCard/index.html",//绑卡链接
                Current:"FinanceAccount",  //当前选中菜单
                InvestAccountUrl:"../demoMyAccount11/index.html",//投资账户总览链接
                InvestListUrl:"../demoMyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../demoMyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../demoUserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../demoUserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../demoFinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../demoFinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../demoAccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../demoCompanyMessageCenter/index.html"//融资消息中心
            }
        })
        // 个人投资信息
        var accountInvestDM = new UDM({
            value: {
                AccType:1,
                UncollectedPrincipal:"",//待收本金
                UncollectedIncome:"",//待收收益
                TotalIncome:""//累计收益
            }
        })

        //投资记录模型
        var investRecordDM = new UDM({
            value:[
                {
                    ProjectUrl:"../demoFinanceInvestDetail/index.html", //项目详情链接
                    ProjectName:  "商票理财【20160002】",//项目名
                    ProjectType:  "6.30",	//项目类型（0普通项目，1专属项目）
                    Amount:  "98101000.00",	//融资规模
                    FinanceRate:"8.35",	//融资利率
                    Duration: "21",	//融资期限
                    F_Status: "3",	//融资项目状态还款中=1, 还款完成=2,  融资完成=3,投标中 = 4,预热中 = 5,项目流标 = 6,
                    F_Text:"融资完成",
                    Progress: "100",	//融资进度
                    RepayBegin: "2017-03-20" //还款日期
                }
            ],
            goFinanceUrl:"../demoBorrow/index.html"
        })

        //模拟后台返回数据
        var listValue = [
            {
                ProjectUrl:"../demoFinanceInvestDetail/index.html", //项目详情链接
                ProjectName:  "商票理财【20160002】",//项目名
                ProjectType:  "6.30",	//项目类型（0普通项目，1专属项目）
                Amount:  "98101000.00",	//融资规模
                FinanceRate:"8.35",	//融资利率
                Duration: "21",	//融资期限
                F_Status: "1",	//融资项目状态还款中=1, 还款完成=2,  融资完成=3,投标中 = 4,预热中 = 5,项目流标 = 6,
                F_Text:"已还款",
                Progress: "10",	//融资进度
                RepayBegin: "2017-03-20" //还款日期

            },{
                ProjectUrl:"../demoFinanceInvestDetail/index.html", //项目详情链接
                ProjectName:  "商票理财【20160002】",//项目名
                ProjectType:  "6.30",	//项目类型（0普通项目，1专属项目）
                Amount:  "98101000.00",	//融资规模
                FinanceRate:"8.35",	//融资利率
                Duration: "21",	//融资期限
                F_Status: "1",	//融资项目状态还款中=1, 还款完成=2,  融资完成=3,投标中 = 4,预热中 = 5,项目流标 = 6,
                F_Text:"已还款",
                Progress: "10",	//融资进度
                RepayBegin: "2017-03-20" //还款日期

            },{
                ProjectUrl:"../demoFinanceInvestDetail/index.html", //项目详情链接
                ProjectName:  "商票理财【20160002】",//项目名
                ProjectType:  "6.30",	//项目类型（0普通项目，1专属项目）
                Amount:  "98101000.00",	//融资规模
                FinanceRate:"8.35",	//融资利率
                Duration: "21",	//融资期限
                F_Status: "1",	//融资项目状态还款中=1, 还款完成=2,  融资完成=3,投标中 = 4,预热中 = 5,项目流标 = 6,
                F_Text:"已还款",
                Progress: "10",	//融资进度
                RepayBegin: "2017-03-20" //还款日期

            },{
                ProjectUrl:"../demoFinanceInvestDetail/index.html", //项目详情链接
                ProjectName:  "商票理财【20160002】",//项目名
                ProjectType:  "6.30",	//项目类型（0普通项目，1专属项目）
                Amount:  "98101000.00",	//融资规模
                FinanceRate:"8.35",	//融资利率
                Duration: "21",	//融资期限
                F_Status: "1",	//融资项目状态还款中=1, 还款完成=2,  融资完成=3,投标中 = 4,预热中 = 5,项目流标 = 6,
                F_Text:"已还款",
                Progress: "10",	//融资进度
                RepayBegin: "2017-03-20" //还款日期

            },{
                ProjectUrl:"../demoFinanceInvestDetail/index.html", //项目详情链接
                ProjectName:  "商票理财【20160002】",//项目名
                ProjectType:  "6.30",	//项目类型（0普通项目，1专属项目）
                Amount:  "98101000.00",	//融资规模
                FinanceRate:"8.35",	//融资利率
                Duration: "21",	//融资期限
                F_Status: "1",	//融资项目状态还款中=1, 还款完成=2,  融资完成=3,投标中 = 4,预热中 = 5,项目流标 = 6,
                F_Text:"已还款",
                Progress: "10",	//融资进度
                RepayBegin: "2017-03-20" //还款日期

            }
        ];
        var ajaxFn = function () {
            var pageSize = paginationDM.getValue().pageSize;	//获取每页显示条数
            var curPage = paginationDM.getValue().curPage;		//获取当前选中页码
            

            var curListValue = [];

            var paginationValue = {
                totalPage: Math.ceil(listValue.length/pageSize),	//总页数
                pageSize: pageSize,	//每页显示条数
                curPage: curPage	//当前页码
            }

            var account = {
                UncollectedPrincipal:"1000",//待收本金
                UncollectedIncome:"10",//待收收益
                TotalIncome:"100"//累计收益
            }

            var realName = {
                AccType:1,
                Mobile:"155****2132",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../demoUserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../demoUserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../demoMyBankCard/index.html",//绑卡链接
                Current:"FinanceAccount",  //当前选中菜单
                InvestAccountUrl:"../demoMyAccount11/index.html",//投资账户总览链接
                InvestListUrl:"../demoMyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../demoMyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../demoUserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../demoUserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../demoFinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../demoFinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../demoAccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../demoCompanyMessageCenter/index.html"//融资消息中心
            }
            if(listValue.length>0){
                for(var i = curPage*pageSize - pageSize ; i < curPage*pageSize ; i ++){
                    if(listValue[i]){
                        curListValue.push(listValue[i]);
                    }
                }
            }

            paginationDM.setValue(paginationValue);
            investRecordDM.setValue(curListValue);
            accountInvestDM.setValue(account);
            realNameInfoDM.setValue(realName)
        }
        var PageDM = {
            pagination: paginationDM,
            investRecord: investRecordDM,
            accountInvest: accountInvestDM,
            realNameInfo: realNameInfoDM
        }
        UEventHub.on('pageLoad', function(v){
            ajaxFn();
            console.log(v);
            UEventHub.emit("test","你好，","世界！");
        });
    </script>
<script type="text/javascript" src="../demoFinanceAccount\index.js"></script></body>
</html>